﻿<%
'Var 
	'dim adInteger, adVarChar,adParamInput,adParamReturnValue,adDate
	adInteger=3
	adVarChar=200
	adParamInput=1
	adParamReturnValue=4
	adDate=4
	adBoolean = 11
	adVarWChar = 202


	function CreateConnection()
		Set conn = Server.CreateObject("ADODB.Connection")
		conn.Open "Provider=SQLOLEDB;Connection Timeout=90;" & strCon
		CreateConnection = conn
		
	End function
	
	function SqlExecuteReader(cmdText)
		set rs=Server.CreateObject("adodb.recordset")
		rs.CursorLocation = 3
		conn=CreateConnection()
		set SqlExecuteReader = conn.Execute(cmdText)
	End function
	
	function sp_BuildAdoCommand(cmdText)
		set cmd1 = server.createobject("adodb.command")
		with cmd1
			.activeconnection = CreateConnection()
			.commandtext = cmdText
			.CommandType = 4 'Stored
		End With	
		set sp_BuildAdoCommand=cmd1
	End function
	
	function sql_BuildAdoCommand(cmdText)
		set cmd1 = server.createobject("adodb.command")
		with cmd1
			.activeconnection = CreateConnection()
			.commandtext = cmdText
		End With	
		set sql_BuildAdoCommand=cmd1
	End function


	
	
	function SqlFree(rs)
		rs.ActiveCommand.Close
		set rs.ActiveCommand = nothing
		rs.Close
		set rs=nothing
	End function 
	
%>